Skip to content

Conversation

@denisborovnev
Copy link
Collaborator

@denisborovnev denisborovnev commented Sep 24, 2021

allow forcing multiline jsx attributes (if first attribute is moved to the new line then save multiline mode)

example

<MyComponent 
    a1={1} a2={2}
/>

will be formatted as

<MyComponent
   a1={1}
   a2={2]
/>   

but

<MyComponent a1={1} a2={2} />

// or

<MyComponent a1={1} 
     a2={2} />

will be formatted as (if there is enough space by print-width option)

<MyComponent a1={1} a2={2} />   

if somebody typed first attribute on the new line then print all the attributes
on the new line.

otherwise left all the atributes on the single line if there is enough space
@denisborovnev denisborovnev changed the title Jsx force new line attributes Jsx force multiline attributes Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant